#include <stdio.h>
#include <cexceptions/cexceptions.h>

void nested_function(){
  throw(THROWABLE_INVALID_ARGUMENT, "test", -1, NULL);
}

int main(int argc, char ** args){
  try(){
    try(){
      nested_function();
    }catch(THROWABLE_RUNTIME_ERROR){
      fprintf(stderr, "Catched %s\n", "THROWABLE_RUNTIME_ERROR");
    }catch(){
      propagate();
    }etry()
  }catch(){
    fprintf(stderr, "CATCHED %T\n", thrown());
    throw(THROWABLE_RUNTIME_ERROR, "UNHANDLED EXCEPTION", 0, thrown());
  }etry()
}
